package com.xzzz.irda.guardcat.core.metric.memory;

import java.io.Serializable;

/**
 * 基础内存使用信息
 *
 * @author xzzz
 * @since 1.0.0
 */
public class BaseMemoryUsageInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 内存名称
     */
    private final String name;

    /**
     * 内存使用情况：获取大致的内存使用情况
     * 对于垃圾回收的内存池，已用内存量包括池中所有对象占用的内存。
     */
    private final UsageInfo usageInfo;

    public BaseMemoryUsageInfo(String name, UsageInfo usageInfo) {
        this.name = name;
        this.usageInfo = usageInfo;
    }

    public String getName() {
        return name;
    }

    public UsageInfo getUsageInfo() {
        return usageInfo;
    }

    @Override
    public String toString() {
        return "内存使用信息{" +
                "名称='" + name + '\'' +
                ", 内存使用情况=" + usageInfo +
                '}';
    }
}
